﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Data.OleDb;

using FRL.DebtChased.Extensions;
using FRL.DebtChased.Repository;
using FRL.DebtChased.Repository.PartModels;
using FRL.DebtChased.Repository.ViewModels;
using FRL.DebtChased.Types;
using FRL.DebtChased.WebServices;

namespace DataTakeOn
{

	/// <summary>
	/// Declaration of Program class
	/// </summary>
	class Program
	{

		/////////////////////////////////////////////////////////////
		// Static Operations

		static void Main(string[] args)
		{

			// Entiity repository
			using (DebtChasedEntities ent = new DebtChasedEntities())
			{

				// tidy up before publishing
				_prePublish(ent);

			}

		}

		private static void _prePublish(DebtChasedEntities ent )
		{

			// Delete all user-actions
			string strSql = "DELETE FROM tbUserAction";
			ent.ExecuteStoreCommand(strSql);

			// Delete all user-access
			strSql = "DELETE FROM tbUserAccess";
			ent.ExecuteStoreCommand(strSql);

			// Delete all error-log
			strSql = "DELETE FROM tbErrorLog";
			ent.ExecuteStoreCommand(strSql);

			// Delete all error-log
			strSql = "DELETE FROM tbDevMessage";
			ent.ExecuteStoreCommand(strSql);

		}

	}

}
